package com.fulong.dao;

import com.fulong.entity.DevicePayInfoEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * 
 * 
 * @author fulong
 * @email ${email}
 * @date 2022-04-09 10:29:46
 */
@Mapper
public interface DevicePayInfoDao extends BaseMapper<DevicePayInfoEntity> {

    @Select("select \n" +
            "device_pay_info.nums as nums,\n" +
            "device_pay_info.price as price,\n" +
            "device_baise_info.label as label\n" +
            "from device_lend_record INNER  JOIN device_pay_info on device_lend_record.deviceid = device_pay_info.id \n" +
            "LEFT JOIN device_baise_info ON device_baise_info.id=device_pay_info.type\n" +
            "where device_lend_record.id = #{id}")
    public Map<String , Object> getBuyRecordInfo(String id);
}
